package org.hk.proxy.client.config;

import cn.hutool.core.io.resource.ClassPathResource;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Properties;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class ClientConfig {
    private String clientKey;
    private String serverIp;
    private Integer serverPort;
    private static Properties properties = new Properties();

    static {
        try {
            properties.load(new ClassPathResource("config.properties").getStream());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static final ClientConfig CLIENT_CONFIG = new ClientConfig();
    private ClientConfig() {
        this.serverIp=properties.getProperty("server.ip");
        this.serverPort=Integer.valueOf(properties.getProperty("server.port"));
        this.clientKey=properties.getProperty("server.clientKey");
    }

    public String getServerIp() {
        return serverIp;
    }

    public Integer getServerPort() {
        return serverPort;
    }

    public String getClientKey() {
        return clientKey;
    }

    public void setServerPort(Integer serverPort) {
        this.serverPort = serverPort;
    }

    public void setServerIp(String serverIp) {
        this.serverIp = serverIp;
    }
}
